package cn.shujuhai.qtadmin.platform.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.shujuhai.qtadmin.platform.pluging.search.SearchModel;
import cn.shujuhai.qtadmin.platform.service.BaseService;

/**
 * BaseServiceImpl
 *
 * @author dch798
 * @date 2021/10/05 17:07
 **/
public class BaseServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<M, T> implements BaseService<T> {

    @Override
    public List<T> list(SearchModel<T> searchModel) {
        return baseMapper.selectList(searchModel.getQueryModel());
    }

    @Override
    public IPage<T> page(SearchModel<T> searchModel) {
        return baseMapper.selectPage(searchModel.getPage(), searchModel.getQueryModel());
    }
}
